﻿@using Microsoft.AspNet.Identity
@using Back_end.Models
@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
        @Html.AntiForgeryToken()

        <ul class="nav navbar-nav navbar-right">
            @if (User.IsInRole("SuperUser"))
            {
                <li>@Html.ActionLink("查看管理员", "Admins", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
            }
            <li>
                @Html.ActionLink("你好，" + User.Identity.GetUserName() + "！", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
            </li>
            <li><a href="javascript:document.getElementById('logoutForm').submit()">注销</a></li>
        </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li>@Html.ActionLink("登录", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}
